﻿using System;
using System.Drawing;
using DevExpress.LookAndFeel;
using DevExpress.XtraSplashScreen;
using XCI.Core;
using XCI.Helper;

namespace XCI.Windows
{
    public partial class FrmSplashScreen : SplashScreen
    {
        public FrmSplashScreen()
        {
            InitializeComponent();

            labTitle.Text = null;
            UserLookAndFeel.Default.SetSkinStyle(SkinSvgPalette.Office2019Colorful.Default);
            var font = new Font("微软雅黑", 9.75f); ;// WindowsFormsSettings.DefaultFont;
            labCopyright.Font = lblCaption.Font = font;
            //labTitle.Font = new Font("微软雅黑", 16F, FontStyle.Bold);

            //labTitle.Text = "西安市维修驾培行业管理系统";
            //labelControl1.Text += DateTime.Now.Year.ToString();
            //

            //ISvgPaletteProvider palette = SvgPaletteHelper.GetSvgPalette(this.TargetLookAndFeel.ActiveLookAndFeel, DevExpress.Utils.Drawing.ObjectState.Normal);
            //SvgImage svg = XCI.Sys.Properties.Resources.DX_Logo;//SvgResources.GetSvgImage("DX Logo");
            //pictureBox1.Image = new SvgBitmap(svg).Render(palette);
            //svg = XCI.Sys.Properties.Resources.App_Logo;//SvgResources.GetSvgImage("Instance Logo");
            //pictureBox2.Image = new SvgBitmap(svg).Render(palette);

            //NativeMethods.SetForegroundWindow(this.Handle);

            labTitle.Text = App.Setting.Name;
            WinFormHelper.CenterControl(this, labTitle, this, true, false);
        }

        public override void ProcessCommand(Enum cmd, object arg)
        {
            base.ProcessCommand(cmd, arg);
            //var command = (SplashCommand)cmd;
            //if (command == SplashCommand.ShowMessage)
            //{
            //    string msg = arg == null ? string.Empty : arg.ToString();
            //    lblCaption.Text = msg;
            //}
        }
    }
}
